import QtQuick 2.15

Item {
    id: buttonRoot
    property bool isSelected
    property string title

    signal clicked

    MouseArea {
        id: delegateMA
        anchors.fill: parent
        anchors.topMargin: -15

        Connections {
            target: delegateMA
            onClicked: buttonRoot.clicked()
        }
    }

    Text {
        anchors.centerIn: parent
        text: parent.title
        font.pixelSize: 40
        font.family: "Roboto"
        color: buttonRoot.isSelected ? "#3C94EB" : "white"
    }

    Image {
        anchors.bottom: parent.bottom
        anchors.horizontalCenter: parent.horizontalCenter
        source: "assets/selected.png"
        visible: buttonRoot.isSelected
    }
}
